﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HardwareInterface;
using System.Drawing;
namespace HardwareInterface
{
    class Program
    {
        static void Main(string[] args)
        {
            FingerScan fs = new FingerScan();
            FingerScanApp ap =  new FingerScanApp();
            int init = ap.InitDevice();
            if ( init == 0)
            { return; }//连接失败
            else if (init == -1)
            { return; }//打开设备失败
            byte []a = new byte[512];
            int size = 0;
            byte[] b = new byte[256];
            int size2 = 0;
            Bitmap bmp, bmp1, bmp2;
            bmp = new Bitmap(255, 288);
            bmp1 = new Bitmap(255, 288);
            bmp2 = new Bitmap(255, 288);
            ap.RegisterFinger_Part1(ref bmp1);
            int res = ap.RegisterFinger_Part2(ref a, ref size,ref bmp2);
            if (res == 0)
            {
                int x = 1;
            }
            ap.GetLoginFinger(ref b, ref size2,ref bmp);
            if (ap.Match(a, b))
            {
                int x = 1;
            }
            else
            {
                int x = 2;
            }
            ap.ReleaseDevice();
        }
    }
}
